#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
const int N = 3010;
int g[N][N], h[N][N];
int n, m, p;
int stk[N], top;
int work(int h[])
{
    int l[N] = { 0 }, r[N] = { 0 };
    h[0] = h[m + 1] = -1;
    top = 0;
    stk[++top] = 0;
    for (int i = 1; i <= m; i++)
    {
        while (h[i] <= h[stk[top]]) top--;
        l[i] = stk[top];
        stk[++top] = i;
    }
    top = 0;
    stk[++top] = m + 1;
    for (int i = m; i >= 1; i--)
    {
        while (h[i] <= h[stk[top]]) top--;
        r[i] = stk[top];
        stk[++top] = i;
    }
    int res = 0;
    for (int i = 1; i <= m; i++)
    {
        res = max(res, h[i] * (r[i] - l[i] - 1));
    }
    return res;
}
int main()
{
    cin >> n >> m >> p;
    for (int i = 0; i < p; i++)
    {
        int x, y;
        cin >> x >> y;
        g[x][y] = 1;
    }
    for (int i = 1; i <= n; i++)
    {
        for (int j = 1; j <= m; j++)
        {
            if (!g[i][j]) h[i][j] = h[i - 1][j] + 1;
        }
    }
    int res = 0;
    for (int i = 1; i <= n; i++) res = max(res, work(h[i]));
    cout << res << endl;
    return 0;
}